﻿using System.Windows;
using System.Windows.Threading;
using ThePresenter.UserInterface;

namespace ThePresenter
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
		/// <summary>
		/// Handles the Startup event of the Application control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="System.Windows.StartupEventArgs"/> instance containing the event data.</param>
		private void Application_Startup(object sender, StartupEventArgs e)
		{
#if NETWORK
			this.MainWindow = new ThePresenter.Network.NetDebugPH();
			this.MainWindow.Show();
			return;
#endif
			this.MainWindow = new MainWindow();
			this.MainWindow.Show();
		}

		/// <summary>
		/// Handles the DispatcherUnhandledException event of the Application control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="System.Windows.Threading.DispatcherUnhandledExceptionEventArgs"/> instance containing the event data.</param>
		private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
		{
			MessageBox.Show(e.ToString());
			;
		}
	}
}
